import Vue from 'vue'
import Router from 'vue-router'
import Index from '@/pages/index/index.vue'
import User from '@/pages/user/user.vue'
import UserDetails from '@/pages/user/details.vue'
import Authority from '@/pages/authority/authority.vue'
import Indent from '@/pages/indent/indent.vue'
import Shop from '@/pages/shop/shop.vue'
import System from '@/pages/system/system.vue'

Vue.use(Router)

export default new Router({
	routes: [{
		path: '/',
		name: 'Index',
		component: Index,
		// 路由重定向  /重定向到/user
		redirect:'/user',
		// 嵌套路由
		children: [{
			path: '/user',
			name: 'User',
			component: User,
		},{
			path: '/authority',
			name: 'Authority',
			component: Authority,
		},{
			path: '/indent',
			name: 'Indent',
			component: Indent,
		},{
			path: '/shop',
			name: 'Shop',
			component: Shop,
		},{
			path: '/system',
			name: 'System',
			component: System,
		},{
			// 接收参数
			path: '/user_details/:id',
			name: 'UserDetails',
			component: UserDetails,
			// 传递参数
			props: true
		}]
	}]
})
